package com.lc.mapper;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liuc
 * @date 2021/5/5
 * @description 应用, webapps下的文件夹名称
 **/
public class Context {

    private String name;
    private Map<String,Wrapper> wrapperMap = new HashMap<>();
    private Wrapper defaultWrapper;
    private String dir;

    public Context(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, Wrapper> getWrapperMap() {
        return wrapperMap;
    }

    public void addWrapper(Wrapper wrapper){
        if(defaultWrapper == null){
            defaultWrapper = wrapper;
        }
        this.wrapperMap.put(wrapper.getUrl(),wrapper);
    }

    public Wrapper getDefaultWrapper() {
        return defaultWrapper;
    }

    public void setDefaultWrapper(Wrapper defaultWrapper) {
        this.defaultWrapper = defaultWrapper;
    }

    public String getDir() {
        return dir;
    }

    public void setDir(String dir) {
        this.dir = dir;
    }
}
